using System.Threading.Tasks;
using RawRestructure.Models;

namespace RawRestructure.Services.Interfaces;

/// <summary>
/// 配置服务接口
/// </summary>
public interface IConfigService
{
    /// <summary>
    /// 异步解析配置文件
    /// </summary>
    /// <param name="configPath">配置文件路径</param>
    /// <returns>图像配置信息</returns>
    Task<ImageConfig?> ParseConfigFileAsync(string configPath);

    /// <summary>
    /// 检测配置文件是否存在
    /// </summary>
    /// <param name="directoryPath">目录路径</param>
    /// <returns>配置文件路径，如果不存在则返回null</returns>
    string? DetectConfigFile(string directoryPath);
    
    /// <summary>
    /// 获取工作站IP地址
    /// </summary>
    /// <returns>工作站IP地址</returns>
    string GetWorkstationIp();
    
    /// <summary>
    /// 获取工作站端口
    /// </summary>
    /// <returns>工作站端口</returns>
    int GetWorkstationPort();
    
    /// <summary>
    /// 保存工作站配置
    /// </summary>
    /// <param name="ip">IP地址</param>
    /// <param name="port">端口</param>
    void SaveWorkstationConfig(string ip, int port);
    
    /// <summary>
    /// 获取批量发送批次大小
    /// </summary>
    /// <returns>批次大小</returns>
    int GetBatchSize();

    /// <summary>
    /// 获取批量发送间隔时间(ms)
    /// </summary>
    /// <returns>间隔时间(ms)</returns>
    int GetSendIntervalMs();

    /// <summary>
    /// 获取模拟发送延迟时间(ms)
    /// </summary>
    /// <returns>延迟时间(ms)</returns>
    int GetMockDelayMs();
} 